package com.probox.common.entity.mapper.order;

import com.probox.common.entity.domain.order.OrderInfoItem;
import com.probox.common.entity.vo.customerService.CustomerServiceBuyRecordVo;
import com.probox.common.entity.vo.statistics.*;
import com.probox.customer.api.domain.CustomerGroupDefinitionQuery;
import com.probox.common.entity.domain.order.OrderInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.probox.order.api.domain.ItemSettlementVo;
import com.probox.order.api.domain.OrderQuery;
import com.probox.order.api.domain.OrderSettlementVo;
import com.probox.product.api.domain.ProductOptVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 订单子Mapper接口
 *
 * @author usoft
 * @date 2021-05-27
 */
@Mapper
public interface OrderInfoMapper extends BaseMapper<OrderInfo> {

    List<ItemSettlementVo> getBySettlement(ItemSettlementVo itemApi);

    List<OrderSettlementVo> selectOrderById(ItemSettlementVo itemApi);

    List<OrderSettlementVo> selectOrderByIds(@Param("itemUids") Long[] itemUids);

    List<OrderInfoItem> getStaticOrder(@Param("storeId") Long storeId,@Param("time") String time);
    /**
     * 统计客户购买的服务项目和套餐卡的相关数据
     *
     * @param name
     * @return
     */
    List<BuyRecordNotUsed> selectNotUsedBuyRecord(BuyRecordNotUsed name);

    /**
     * 统计客户购买的服务项目和套餐卡的详情
     *
     * @param used
     * @return
     */
    List<CustomerServiceBuyRecordVo> getNotUsedBuyRecordDetail(BuyRecordNotUsed used);

    /**
     * 统计订单
     *
     * @param orderInfo
     * @return
     */
    Integer selectOrderCount(OrderInfo orderInfo);

    /**
     * 编号查询
     *
     * @param query
     * @return
     */
    List<Long> getOrderUidByNo(OrderQuery query);

    /**
     * 有效时间，订单数和订单总额
     *
     * @param query
     * @return
     */
    List<ProductOptVo> getOptCount(CustomerGroupDefinitionQuery query);

    /**
     * 销售统计报表
     *
     * @param vo
     * @return
     */
    List<ProductSaleVo> selectProductSale(ProductSaleVo vo);

    /**
     * 销售统计报表
     *
     * @param vo
     * @return
     */
    ProductSaleVo selectOrderCountAndAmount(ProductSaleVo vo);

    /**
     * 根据类型和id查询对应的订单数据
     *
     * @param vo
     * @return
     */
    List<OrderInfoItem> selectItemByProUidAndType(ProductSaleVo vo);


    /**
     * 耗卡统计报表
     *
     * @param vo
     * @return
     */
    List<CardConsumptionSaleVo> selectCardConsumptionSale(CardConsumptionSaleVo vo);

    List<SubscribeDetailVo> selectCardConsumptionSaleDetail(CardConsumptionSaleVo vo);

    /**
     * 耗卡统计报表
     *
     * @param vo
     * @return
     */
    CardConsumptionSaleVo selectCardConsumptionCountAndAmount(CardConsumptionSaleVo vo);

    /**
     * 耗卡报表详情
     *
     * @param vo
     * @return
     */
    List<CardConsumptionSaleDetailVo> selectCardConsumptionSaleByProUidAndType(CardConsumptionSaleDetailVo vo);

    List<SubscribeDetailVo> selectHomeCardConsumptionSaleDetail(CardConsumptionSaleVo vo);

    /**
     * 门店销售报表
     *
     * @param vo
     * @return
     */
    List<StoreManagementVo> selectStoreManagementVo(StoreManagementVo vo);

    /**
     * 储值统计报表
     *
     * @return
     */
    List<StoreRechargeVo> selectStoreRechargeVo(StoreRechargeVo vo);

    /**
     * 美容师报表
     *
     * @param vo
     * @return
     */
    List<BeauticianRankingVo> selectBeauticianRankingVo(BeauticianRankingVo vo);

    /**
     * 美容师报表
     *
     * @param vo
     * @return
     */
    BeauticianRankingVo selectBeauticianRankingVoCount(BeauticianRankingVo vo);

    /**
     * 美容师报表明细
     *
     * @param vo
     * @return
     */
    List<CardConsumptionSaleDetailVo> selectBeauticianRankingDetail(BeauticianRankingVo vo);


    /**
     * 注册转换统计
     *
     * @param vo
     * @return
     */
    List<RegistrationConversionVo> selectRegistrationConversion(RegistrationConversionVo vo);

    /**
     * 耗卡渠道数据报表
     *
     * @return
     */
    List<ChannelVo> selectChannelVo(BeauticianRankingVo vo);

    /**
     * 耗卡渠道数据报表
     *
     * @return
     */
    ChannelVo selectChannelVoStatistics(BeauticianRankingVo vo);

    /**
     * 其他数据
     *
     * @param vo
     * @return
     */
    OtherVo selectOtherVo(OtherVo vo);


    /**
     * 其他数据列表
     *
     * @param vo
     * @return
     */
    List<OtherVo> listOtherVo(OtherVo vo);

    List<OtherVo> listOtherVoTimes(OtherVo vo);

    /**
     * 查询对账数据报表
     *
     * @param vo
     * @return
     */
    List<ReconciliationVo> selectReconciliationVo(ReconciliationVo vo);

    List<KuaDianVo> selectKuaDianList(ReconciliationVo vo);

    ReconciliationVo selectReconciliationVoManCount(ReconciliationVo vo);
    ReconciliationVo selectReconciliationVoItemCount(ReconciliationVo vo);

    ReconciliationVo selectReconciliationVoKuaDianShouRuAndZhiChu(ReconciliationVo vo);
}
